Page({
  onShow() {
    if (my.isIDE) {
      this.handleSkip()
    }
    this.data.timer = setTimeout(()=>{
      this.handleSkip()
    }, 2000)
  },
  data: {
    timer: 0
  },
  handleSkip() {
    const pages = getCurrentPages();
    const currentPage = pages[pages.length - 1];
    if (currentPage.route !== "pages/splash_screen/index") {
      return
    }

    clearTimeout(this.data.timer)
    if (my.WebIM.conn.isOpened()) {
      my.redirectTo({
        url: '/pages/chat/chat',
      })
    } else {
      my.redirectTo({
        url: '/pages/login_token/login_token',
      })
    }
  }
})